package com.example.basic.app_support;

import com.google.gson.Gson;

import java.util.ArrayList;

public class SupportTypeJsonStrBuilder {

    public static String[] fileExtensions = new String[]{
            "mp4","mp3","avi","txt","word","mp3","apk"
    };

    /*
    [{"id":0,"fileExtension":"mp4","minSupportVersion":"2.0.1.7"},{"id":1,"fileExtension":"mp3","minSupportVersion":"2.0.1.7"},{"id":2,"fileExtension":"avi","minSupportVersion":"2.0.1.7"},{"id":3,"fileExtension":"txt","minSupportVersion":"2.0.1.7"},{"id":4,"fileExtension":"word","minSupportVersion":"2.0.1.7"},{"id":5,"fileExtension":"mp3","minSupportVersion":"2.0.1.7"},{"id":6,"fileExtension":"apk","minSupportVersion":"2.0.1.7"}]
     */
    public static void main(String[] args) {
        ArrayList<SupportType> supportTypeArrayList = new ArrayList<>();
        for (int i = 0; i < fileExtensions.length; i++) {
            supportTypeArrayList.add(new SupportType(i,fileExtensions[i],"2.0.1.7"));
        }


        Gson gson = new Gson();
        String json = gson.toJson(supportTypeArrayList);
        System.out.println(json);
    }

}
